﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ExpenseSystem.Common;
using ExpenseSystem.Common.BaseModel;
using ExpenseSystem.DataUpdater;
using ExpenseSystem.Fether;
using ExpenseSystem.Model;
using ExpenseSystem.Core.DataAddOn;
using System.Web;

namespace ExpenseSystem.Core.ProductionModules
{
    public class SeriesManager : INormalManager<SeriesModel>
    {
        protected string tran = HttpContext.Current.Items[Definition.SESSION_TRAN_STR].ToString();
        SeriesFetcher fetcher = new SeriesFetcher();
        protected UserProfile userProfile = Authority.Authority.GetUserProfile();
        protected NormalDataUpdater<SeriesModel> SeriesUpdater = new SeriesUpdaterRegister().GetSeriesUpdater();

        public virtual bool Delete(SeriesModel role,  out string message)
        {
            bool result = SeriesUpdater.Remove(role, tran, fetcher, out message);
            return result;
        }
        public virtual bool DeleteById(long[] SeriesId, out string message)
        {
            bool result = true;
            result = SeriesUpdater.RemoveById(userProfile.SiteId, SeriesId, tran, fetcher, out message);
            return result;
        }
        public virtual bool Save(SeriesModel Series, out string message, params IAddable<SeriesModel>[] addables)
        {
            return SeriesUpdater.Save(Series, tran, fetcher, out message);
        }

    }
}
